package cn.tedu.spring.ti3;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test01 {
    @Test
    public void test010()
    {
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("beans.xml");
//        Student student=(Student)applicationContext.getBean("student");
//        Teacher teacher=(Teacher) applicationContext.getBean("teacher");
//        System.out.println(student);
//        System.out.println(teacher);
        Demo demo=(Demo) applicationContext.getBean("demo");
        System.out.println(demo);
        ((ClassPathXmlApplicationContext)applicationContext).close();
        //@注解 Component
//        类中第二个字母小写  我们写getBean时第一个字母写小写
//           第二个为大写     第一个字母不变

    }
}
